/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainPane.java
 *
 * Created on Jan 9, 2012, 11:51:07 AM
 */
package views.panes;

import controller.human.User;
import java.awt.GridLayout;
import views.MafiaFrame;

/**
 *
 * @author darkdev
 */
public class MainPane extends javax.swing.JPanel {

    /** Creates new form MainPane */
    MafiaFrame gui;
    public MainPane(MafiaFrame gui) {
        initComponents();
        this.gui = gui;
        int nrPl = gui.players.size();
        int l = nrPl%4;
        int c = 4;
        this.players.setLayout(new GridLayout(l, c));
        for(User pl:gui.players)
        {
            
        }
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        phase = new javax.swing.JLabel();
        startNight = new javax.swing.JButton();
        players = new javax.swing.JPanel();

        phase.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        phase.setText("Welcome to a new Mafia Game:");

        startNight.setText("Start Night ");
        startNight.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startNightActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout playersLayout = new javax.swing.GroupLayout(players);
        players.setLayout(playersLayout);
        playersLayout.setHorizontalGroup(
            playersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 297, Short.MAX_VALUE)
        );
        playersLayout.setVerticalGroup(
            playersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 238, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(91, 91, 91)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(phase)
                    .addComponent(players, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(startNight))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(phase)
                .addGap(18, 18, 18)
                .addComponent(players, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(startNight)
                .addGap(31, 31, 31))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void startNightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startNightActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_startNightActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel phase;
    private javax.swing.JPanel players;
    private javax.swing.JButton startNight;
    // End of variables declaration//GEN-END:variables
}
